package com.example.exam.exception;

/**
 * @author
 * @date 2022/7/19
 *
 * 自定义异常类
 */
public class CustomException extends RuntimeException {

    private String code;

    private String message;

    public CustomException(String code, String message) {
        super(code + ":" + message);
        this.code = code;
        this.message = message;
    }

    @Override
    public String toString() {
        return String.format("code:%s\tmessage:%s", this.code, this.message);
    }
}
